package com.axcbd.demo.controller;

import com.axcbd.demo.service.VideoBackupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class VideoBackupController {

    @Autowired
    private VideoBackupService videoBackupService;

    // 启动备份任务的接口
    @GetMapping("/start-backup")
    public String startBackup() {
        videoBackupService.startBackup();
        return "备份任务已启动";
    }

    // 获取备份任务状态的接口
    @GetMapping("/backup-status")
    public Map<String, String> getBackupStatus() {
        return videoBackupService.getBackupTasks();
    }
}